GitHub Actions
GitHub Actionsのドキュメント - GitHub Docs
Actions, GHA
GitHub の CI/CD ツール
リポジトリに.github/workflows/*.ymlを置く
Cronを複数のリポジトリで使用した時
最短で5分で実行されるが、それより長い時間がかかってしまう?
便利な機能
workflow_dispatch
APIや手動でworkflowを実行できる
repository_dispatch
他のrepositoryをトリガーにworkflowを実行できる
マーケットプレイスに公開されている
kubernetes 関連
KinD (Kubernetes in Docker) Action · Actions · GitHub Marketplace
actions-k3s · Actions · GitHub Marketplace
code: aws.yml
name: AWS example workflow
on:
push:
branches:
- main
env:
BUCKET_NAME : "<example-bucket-name>"
AWS_REGION : "<example-aws-region>"
jobs:
main:
runs-on: ubuntu-20.04
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::1234567890:role/example-role
role-session-name: samplerolesession
aws-region: ${{ env.AWS_REGION }}
- name: Copy index.html to s3
run: |
aws s3 cp ./index.html s3://${{ env.BUCKET_NAME }}/
Reference
GitHub Actions のベストプラクティス
GitHub Actionsの共通したアクションを切り出してシンプルに保つ
GitHub Actions Workflow チェックリスト | CyberAgent Developers Blog
大丈夫になりたい | GitHub ActionsによるGitHub Pages更新がベータになりました🎉